#include "BoardCell.h"
#include "BoardCellShape.h" //TODO: remove this testing
 #include <iostream>
 #include <sstream>
 #include <string>

//BoardCell::BoardCell(void)
//{
	//shape = new MuncherShape();
	//name = L"BoardCell";
//}

BoardCell::BoardCell(std::wstring cellText)
{
	//TODO: create a srting wrapper class to hold this string stream stuff
	//std::wostringstream ss;
	//ss << cellNumber;
	//std::wstring str = ss.str();

	shape = new BoardCellShape(cellText);
	name = L"BoardCell";

	this->cellText = cellText;
	isEaten = false;
	
}

BoardCell::~BoardCell(void)
{
}

void BoardCell::SetEaten(bool eaten)
{
	this->isEaten = eaten;
	this->SetVisible(false);
}
bool BoardCell::IsEaten()
{
	return this->isEaten;
}

void BoardCell::SetCellText(std::wstring cellText)
{
	this->cellText = cellText;
}
std::wstring BoardCell::GetCellText()
{
	return this->cellText;
}

double BoardCell::GetCellNumber()
{
	std::string str(cellText.begin(), cellText.end());
	return atof(str.c_str()); //TODO: check if its actually a valid number
}

void BoardCell::SetCellCenter(float x, float y, float z)
{
	cellCenter.x = x;
	cellCenter.y = y;
	cellCenter.z = z;
}

D3DXVECTOR3 BoardCell::GetCellCenter()
{
	return cellCenter;
}